import Vue from 'vue'
import App from './App'
import api from "api/index.js"
import Modal from "./common/modal.js"
import jump from './common/jump.js';
import config from './common/service/config.service.js';
import share from './common/share.js'
import util from './common/util.js'

import uView from "uview-ui";
Vue.use(uView);

import {
	router,
	RouterMount
} from './router.js'
Vue.use(router)

import VueCookies from 'vue-cookies'
Vue.use(VueCookies)
Vue.$cookies.config('60d')

// 小程序分享
import {
	wxShareMixin
} from './mixins/wxShare.js'
Vue.mixin(wxShareMixin)

import HeaderView from './components/header-view.vue'
Vue.component('header-view', HeaderView)

// 导入全局注册的组件库
import pagebox from '@/components/pagebox'; //全局页面组件
import fimg from '@/components/medium/fimg'; //全局图片组件
Vue.component('pagebox', pagebox); //全局页面组件
Vue.component('fimg', fimg); //全局图片组件


import NewsItem from '@/components/news-item'; //全局图片组件
Vue.component('NewsItem', NewsItem); //全局图片组件

let modal = new Modal();
Vue.prototype.$modal = modal;
// jump
Vue.prototype.$jump = jump;
Vue.prototype.$api = api;
Vue.prototype.$config = config;
// share
Vue.prototype.$share = share;
Vue.prototype.$util = util;


Vue.config.productionTip = false;
App.mpType = 'app'

const app = new Vue({
	...App
})

//v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
// #ifdef H5
RouterMount(app, router, '#app');
// #endif

// #ifndef H5
app.$mount(); //为了兼容小程序及app端必须这样写才有效果
// #endif